<template>
    <view id="app">
        <slot></slot>
    </view>
</template>

<script>
export default {
    onLaunch() {
        // 应用启动时检查登录状态
        const token = uni.getStorageSync('token');
        if (!token) {
            uni.reLaunch({
                url: '/pages/home/login'
            });
        }
    },
    onShow() {
        // 检查隐私政策是否同意
        const privacyAgreed = uni.getStorageSync('privacyAgreed');
        if (!privacyAgreed) {
            uni.navigateTo({
                url: '/pages/privacy/index'
            });
        }
    },
    onHide() {
        console.log('应用隐藏');
    }
}
</script>

<style>
@import './static/iconfont.css';

page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    background-color: #F8F8F8;
}
</style> 